package test.h0816;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
import java.util.StringJoiner;

public class Main2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split(",");
        Arrays.sort(s, (o1, o2) -> {
            char a = o1.charAt(o1.length() - 1);
            int a1 = a - '0';
            char b = o2.charAt(o2.length() - 1);
            int b1 = b - '0';
            if (a1 != b1) {
                return a1 - b1;
            }
            return 0;
        });
        StringJoiner joiner=new StringJoiner(",");
        for (int i = 0; i < s.length; i++) {
            joiner.add(s[i]);
        }
        System.out.println(joiner);
    }
}
